package com.oreilly.justspring.core.ch2.ex27;

import javax.management.ObjectName;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class Connection implements InitializingBean, DisposableBean {
	private ObjectName objectName;

	// InitializingBean's method implementation
	public void afterPropertiesSet() {
		registerToJmx(objectName);
	}

	// DisposableBean's method implementation
	public void destroy() {
		unregisterFromJmx(objectName);
	}
	private void registerToJmx(ObjectName objectName2) {
		//impl goes here
	}

	private void unregisterFromJmx(ObjectName objectName2) {
		// impl goes here
	}
}